	<?php $this->load->view('admin/partials/statistics_menu'); ?>
	<?php 
		$ci = &get_instance();
		$showStatus = showStatusDataConfig();
		$bidNumber = 0;
		foreach($items as $item){
			$bidNumber += $ci->bid_entity->getTotalNumberBids($item->ref_no);
		}
	?>
	<h3>Statistics &raquo; <?php echo ucfirst($this->uri->segment(4,''));?></h3>
	
	<div class="clrboth"></div>
	
	<?php $this->load->view('admin/statistics/search_show_partial' ); ?>
	<div class="clrboth"></div>
	<div id="report">
		Number of shows: <?php echo count($items);?><br/>
		Number Of Bids: <?php echo $bidNumber;?>
	</div>
	
	<div class="clrboth"></div>
	<table border="0" class="table-list">
		<thead>
			<tr>
				<th>Name</th>
				<th>Date</th>
				<th>Status</th>
				<th>Winning Bid</th>
				<th>Seller</th>
				<th>Buyer</th>
			</tr>
		</thead>
		
		<tbody>
			<?php foreach( $items as $item ): ?>
			<?php 
				$SHOW = $ci->show_entity->init('id',$item->id);
				$SELLER = clone_( $ci->user_entity->init('id',$SHOW->getUserCreatedId()) );
				$BIDDER = $ci->user_entity->init('id',$SHOW->getUserBidWon());
			?>
			<tr>
				<td><?php echo $SHOW->getName(); ?></td>
				<td><?php echo sbxDateFormat($SHOW->getCreatedTime()); ?></td>
				<td><?php echo $showStatus[$SHOW->getStatus()] ;?></td>
				<td><?php if($BIDDER) echo $ci->bid_entity->getOfferPriceWonBid($SHOW->getRefNo(), $BIDDER->getAccCode()); ?></td>
				<td><?php echo $SELLER->getEmail(); ?></td>
				<td><?php if($BIDDER) echo $BIDDER->getEmail(); ?></td>
			</tr>
			<?php endforeach; ?>
		</tbody>
		
	</table>


